body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #dcdee0;
}

header {
    padding: 15px;
    font-size: 1.5rem;
    background: #1e2a38;
    color: white;
    text-align: center;
}

.main {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sidebar {
    flex: 1 1 300px;
    /* grow, shrink, base width */
    min-width: 250px;
    max-width: 350px;
    background: white;
    padding: 15px;
    border-right: 1px solid #ddd;
    box-sizing: border-box;
}

.rightSide {
    flex: 3 1 500px;
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
}

.preview {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
    border: 1px solid #968f8f;
    border-radius: 6px;
    background-color: #777a7c;
    width: 100%;
    box-sizing: border-box; 
    justify-content: center;
    /* centers icons horizontally */
    align-items: center;
    /* centers icons vertically */
}

.tag-container {
    position: relative;
    width: 100%;

    min-width: 350px;
    aspect-ratio: 16/9;
    /* maintains 750x420 ratio responsively */
    border: 2px dashed #ccc;
    background: #ffffff;
    overflow: hidden;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: 95%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: 95%;
    border-radius: 6px;
     justify-content: center;
    /* centers icons horizontally */
    align-items: center;
    /* centers icons vertically */
}

.dogtag {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    transform-origin: center;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.tag-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3vw;
    /* responsive font size */
    font-weight: bold;
    text-align: center;
    cursor: move;
    white-space: pre;
    background-color: white;
    padding: 0.1em 0.1em;
    border-radius: 12px;
}

.controls label {
    display: block;
    margin-top: 10px;
}

.controls input,
.controls textarea,
.controls select {
    width: 100%;
    margin-top: 5px;
    box-sizing: border-box;
}

button {
    margin-top: 10px;
    padding: 0.8em;
    cursor: pointer;
    border: none;
    background: #1e88e5;
    color: white;
    border-radius: 6px;
}

.secondary {
    background: #43a047;
}

.gallery {
    padding: 10px;
    background-color: white;
    margin-bottom: 20px;
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.column {
    width: 22%;
    border: 1px solid darkgrey;
    border-radius: 6px;
}

.column img {
    width: 100%;
    cursor: pointer;
    opacity: 0.8;
}

.column img:hover {
    opacity: 1;
}

/* MEDIA QUERIES FOR MOBILE AND TABLET */
@media screen and (max-width: 900px) {
    .main {
        flex-direction: column;
    }

    .sidebar {
        max-width: 100%;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    .tag-text {
        font-size: 6vw;
        padding: 0.2em 0.2em;
    }

    .column {
        width: 45%;
    }
}

@media screen and (max-width: 500px) {
    .column {
        width: 100%;
    }

    .tag-text {
        font-size: 8vw;
        padding: 0.2em 0.2em;
    }
}

.controlPanel {
    flex: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;

    background-color: rgb(198, 240, 241);
    border-radius: 8px;
}

.controlPanelButton2 {
    flex: 1;
    display: flex;
    justify-content: center;
    /* centers icons horizontally */
    align-items: center;
    /* centers icons vertically */
    gap: 40px;
    /* spacing between icons */
    width: 100%;
    text-align: center;
    font-size: 48px;
    color: rgb(15, 189, 226);
    cursor: pointer;
}

.moveIcon {
    font-size: 48px;
    color: rgb(15, 189, 226);
    cursor: pointer;

}

.row {
    display: flex;
}

.col1 {
    flex: 0 0 8.33333%;
}

.col6 {
    flex: 0 0 40%;
    max-width: 40%;
}

.controlPanel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 12px;
}


.controlPanelVertical {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    padding: 12px;

    justify-items: center;
    align-items: center;

    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  
    overflow: hidden; /* prevents spill-out */
}

.controlButton {
    flex: 1 1 80px;   /* grows, shrinks, and wraps at ~120px */
    max-width: 100%;

    font-size: 32px;
    padding: 18px;
    border-radius: 14px;
    background: #f0f0f0;

    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
}


@media (max-width: 420px) {
  .controlButton {
    font-size: 24px;
    padding: 10px;
  }

  .controlPanelVertical {
    gap: 12px;
  }
}



@media (max-width: 600px) {
    .controlPanel {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }

    .controlButton {
        font-size: 56px;
        padding: 22px;
    }
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    /* prevents wrapping */
}

/* Switch container */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

/* Hide default checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Slider */
.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    border-radius: 999px;
    transition: 0.3s;
}

/* Knob */
.switch .slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

/* Checked state */
.switch input:checked+.slider {
    background-color: #2196F3;
}

.switch input:checked+.slider::before {
    transform: translateX(24px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.switch input:checked+.slider {
    background-color: #2196F3;
}

.layoutPanel {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    /* IMPORTANT */
    justify-content: center;
    /* centers icons horizontally */
    align-items: center;
    /* centers icons vertically */

width:100%;
}


.colEnd {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;

    gap: 12px;


    background: #2d77b4;
    border-radius: 12px;

    width: 220px;
    box-sizing: border-box;
}

.middleCol {
    flex: 4;
    min-width: 600px;
    /* your requirement */

}

/* Stack + full width */
@media (max-width: 668px) {
    .layoutPanel {
        flex-direction: column;
    }

    .col,
    .middleCol {
        flex: unset;
        width: 100%;
        min-width: 300px;
        max-width: 100%;
    }
}